<!DOCTYPE html>
<html>

<head>
    <#include "/xhc/admin/components/meta.html" />
    <title>出出帮火车奇妙世界后台 ${metaTitleSuffix!}</title>
    <#include "/xhc/admin/components/stylesheets.html" />
    <style>
        .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
  }
  .avatar {
    width: 178px;
    height: 178px;
    display: block;
  }
</style>
</head>

<body>
    <div id='app'>
        <el-container>
            <#assign menuIndex="1-1" />
            <#include "/xhc/admin/components/menu.html" />
            <el-container>
                <#include "/xhc/admin/components/header.html" />
                <el-main>
                    <template>
                        <el-form ref="form" :model="form" label-width="80px">
                            <el-row :gutter="20">
                                <el-col :span="24">
                                    <el-form-item label='通知公告'>
                                        <el-input type="textarea" :rows="5" placeholder="通知公告" v-model="form.notification">
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="24">
                                    <el-form-item label='营业时间'>
                                        <el-input type="textarea" :rows="5" placeholder="营业时间" v-model="form.businessTime">
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col>
                                    <el-form-item>
                                        <el-button type="primary" @click="onSubmit">保存</el-button>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-form>
                    </template>
                </el-main>
            </el-container>
        </el-container>
        <#include "/xhc/admin/components/footer.html" />
    </div>
    <#include "/xhc/admin/components/scripts.html" />
    <script type="text/javascript">
    var vue = new Vue({
        el: '#app',
        data() {
            return {
                form: {
                    notification: '${notification!'
                    '}',
                    businessTime: '${businessTime!'
                    '}'
                }
            }
        },
        mounted: function() {
            String.prototype.replaceAll  = function(s1,s2){     
                return this.replace(new RegExp(s1,"gm"),s2);     
            }  
            this.form.businessTime = this.form.businessTime.replaceAll('</br>', "\n")
        },
        methods: {
            onSubmit() {
                var businessTime = trimStrBr(this.form.businessTime)
                var param = {
                    notification: this.form.notification,
                    businessTime: businessTime,
                }
                // console.log(param)
                var url = ''
                var ref = '${referer!""}'
                var url = '/xhc/web/ticket/submitInfo'
                axiosRequest(param, url, ref)
            }
        },
        filters: {
            fmt(date) {
                return date
            }
        }
    })
    </script>
    <script>
    // vue.tableData = ${items!};
    </script>
</body>

</html>